<!DOCTYPE html>
<html>
    <head>
        <title>蓝旭第三次作业</title>
    </head>
    <body>
        <h1>第一题</h1>
        <script>
           var arr = [4,0,7,9,0,0,2,6,0,3,1,0];
           var newArr=[];
            for(var i = 0;i < arr.length;i++){
                if(String(arr[i])=='0'){
                    arr.splice(i,1);
                    i=i-1;
                }
            }
            newArr = arr;
            console.log(newArr);
            document.write((newArr));
        </script>
        
    </body>
</html>